/**
 * 
 */
package kr.pe.smallhope.mobismap.widgets;

import kr.pe.smallhope.mobismap.vo.GMapInfoVO;

import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

/**
 * @author silent
 *
 */
public class GMapAddressCoordinateTableLabelProvider extends LabelProvider
        implements ITableLabelProvider, IColorProvider {
    
    /**
     * 
     */
    public GMapAddressCoordinateTableLabelProvider() {
        // TODO Auto-generated constructor stub
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
     */
    public Image getColumnImage(Object element, int columnIndex) {
        // TODO Auto-generated method stub
        return null;
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
     */
    public String getColumnText(Object element, int columnIndex) {
        GMapInfoVO ac = (GMapInfoVO) element;
        switch (columnIndex) {
            case 0:
                return ac.id;
            case 1:
                return ac.queryAddress;
            case 2:
                return ac.address;
            case 3:
                return ac.sphXPoint;
            case 4:
                return ac.sphYPoint;
            case 5:
                return ac.countryNameCode;
            case 6:
                return ac.countryName;
            case 7:
                return ac.administrativeAreaName;
            case 8:
                return ac.subAdministrativeAreaName;
            case 9:
                return ac.localityName;
            case 10:
                return ac.dependentLocalityName;
            case 11:
                return ac.thoroughfareName;
            case 12:
                return ac.addressLine;
            case 13:
                return ac.postalCodeNumber;
            
            default:
                break;
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
     */
    public Color getBackground(Object element) {
        GMapInfoVO ac = (GMapInfoVO) element;
        if (!ac.isValidate) {
            return Display.getDefault().getSystemColor(SWT.COLOR_RED);
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
     */
    public Color getForeground(Object element) {
        // TODO Auto-generated method stub
        return null;
    }
    
}
